/**
 * 
 */
function startTime(){
	var today = new Date();
	var h = today.getHours();
	var m = today.getMinutes();
	var s = today.getSeconds();
	m = checkTime(m);
	s = checkTime(s);
	document.getElementById("timetxt").innerHTML = h+":"+m+":"+s;
	t = setTimeout(function() {
		startTime()
	}, 1000);
}
function checkTime(i){
	if(i<10){
		i = "0"+i;
	}
	return i ;
}
//setTimeout和setInterval两种方法
var mytime = setInterval(function(){
	getTime();
}, 1000);
function getTime(){
	var d = new Date();
	var t = d.toLocaleTimeString();
	document.getElementById("ptime").innerHTML =t;
}